{% extends "office/equipment.html" %}
{% block content %}
<div>
    <div class="row">
        <div class="col-md-4"><strong>设备ID：{{ equipment.id }}</strong></div>
        <div class="col-md-4"><strong>设备编号：</strong>{{ equipment.number }}</div>
        <div class="col-md-4"><strong>当前使用者：</strong>{{ equipment.user }}</div>
    </div>
    <br>

    <div class="row">
        <div class="col-md-4"><strong>设备型号：</strong>{{ equipment.model }}</div>
        <div class="col-md-4"><strong>设备序列号：</strong>{{ equipment.series }}</div>
        <div class="col-md-4"><strong>当前状态：</strong>{{ equipment.status }}</div>
    </div>
    <br>

    <div class="row">
        <div class="col-md-4"><strong>设备来源：</strong>{{ equipment.source }}</div>
        <div class="col-md-4"><strong>设备成本：</strong>{{ equipment.price }}</div>
        <div class="col-md-4"><strong>首次入库日期：</strong>{{ equipment.first_enter_date }}</div>
    </div>
    <br>

    <div class="row">
        <div class="col-md-4"><strong>最近出库日期：</strong>{{ equipment.last_out_date }}</div>
        <div class="col-md-4"><strong>申请出库人：</strong>{{ equipment.registrant }}</div>
        <div class="col-md-4">
            <label for="content">设备备注信息：</label>
            <textarea id="content" class="form-control" rows="5" cols="40">
{{ equipment.remark }}
            </textarea>
         </div>
    </div>
    <br>

    <div class="row">
        <div class="col-md-8"> 该信息被 {{ equipment.creator }} 于 {{ equipment.add_date }} 创建，被 {{ equipment.modifier }} 于 {{ equipment.mod_date }} 最后修改。</div>
    </div>
    <br>

    <a class="btn btn-primary" href="/office/mod_equipment/{{ equipment.number }}" role="button">编辑</a>
    <button id="DeleteEquipment" class="btn btn-primary" href="" role="button">删除</button>

    <script>
        $(function () {
            $("#DeleteEquipment").click(function () {
                if(confirm("确定删除 设备编号: {{ equipment.number }} 设备信息?")){
                    $.get("/office/del_equipment?equipment_id={{ equipment.id }}", function () {
                        window.location.replace("/office");
                    });
                }
            })
        })
    </script>

</div>
{% endblock %}